package com.test.dubbo.service.impl;

import com.test.dubbo.entity.User;
import com.test.dubbo.service.UserService;

import java.util.HashMap;
import java.util.Map;

/**
 * <一句话功能简述> <功能详细描述>
 *
 * @author lk
 * @version 2021/4/28
 * @see [相关类/方法]
 * @since [netty-dubbo]
 */
public class UserServiceImpl implements UserService
{

	private static Map<Long, User> userMap = new HashMap<> ();
	static {
		for(int i = 0 ;i<50;i++){
			User user = new User ();
			user.setId ((long)i);
			user.setName ("name"+i);
			userMap.put (user.getId (),user);
		}
	}
	@Override
	public String getUserNameById (Long id)
	{
		return userMap.get (id).getName ();
	}

}
